<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="myId">
        <div class="lonely">单身</div>
        <div class="outer">
            <div class="inner">
                开花
            </div>
        </div>
    </div>
    <script>
        var myId = document.getElementById('myId')
        var divDom = myId.querySelectorAll('div div')
        console.log(divDom.length)
    </script>
</body>
</html>